  <center>
    <div class="container">
      <div class="row">
      
        <!-- Body mayor -->
        <div class="span7 offset1">
          
          <!-- Main Content -->
          <div class="row">
            
            <!-- Cabecera o titulo -->
            <div>
                <div class="page-header">
                  <h1>Prode</h1>
                </div> 
            </div>
            
            <!-- Cuerpo principal -->
            <div>
              <div class="row">
              
                  <!-- Proxima fecha -->
                  <div class="span4 offset1">
                    <?php
                    if($fecha != false)
                    {
                      ?>
                      <table class="table table-striped table-bordered table-condensed" width="100%">
                              <tr>
                                  <th colspan="4" style="text-align: center">Fecha</th>
                              </tr>
                              <tr>
                                  <th colspan="2" style="text-align: center">Local</th><th colspan="2" style="text-align: center">Visitante</th>
                              </tr>
                      <?php
                      foreach($fecha as $f)
                      {
                          echo '<tr>';
                          echo '<td width="25"><img src="'.base_url().'assets/img/escudos/'.$f['localImage'].'" width="25" height="25"></td>';
                          echo '<td>'.$f['localName'].'</td>';
                          echo '<td style="text-align: right">'.$f['visitName'].'</td>';
                          echo '<td width="25"><img src="'.base_url().'assets/img/escudos/'.$f['visitImage'].'" width="25" height="25"></td>';
                          echo '</tr>';
                      }
                      
                      echo '</table>';
                    
                    }
                    else
                    {
                      echo '
                            <div class="alert alert-error">
                              <strong>Upss!!</strong>
                              No hay una fecha definida, vuelve a ingresar mas tarde.
                            </div>
                            ';
                    }
                    ?>
                  </div>
                  
                  <!-- Posiciones -->
                  <div class="span2">
                    <?php
                    if($positions != false)
                    {
                      
                    ?>
                    <table class="table table-striped table-bordered table-condensed" width="100%">
                      <tr>
                          <th colspan="2" style="text-align: center">Posiciones</th>
                      </tr>
                      <tr>
                          <th style="text-align: center">Usuario</th><th style="text-align: center">Puntos</th>
                      </tr>
                      <?php
                      $i = 0;
                      foreach($positions as $p)
                      {
                        if($i < 10)
                          {
                            echo '<tr>';
                            if($p['realName'] == "" || $p['realName'] == null)
                              echo '<td>'.$p['name'].'</td>';
                              else
                              echo '<td>'.substr($p['realName'], 0, 8)."...</td>";
                            echo '<td style="text-align: right">'.$p['points'].'</td>';
                            echo '</tr>';
                            
                            $i++;
                          }
                          else
                          {
                            break;
                          }
                      }
                      ?>
                    </table>
                    
                    <?php
                    }
                    else
                    {
                      echo '
                          <div class="alert alert-error">
                              Ahún no estan disponibles las posiciones.
                          </div>
                          ';
                    }
                    ?>
                  </div>
              
              </div>
            </div>
          </div>
          
          <!-- Comentarios y/o otras cosas -->
          <!--<div class="row">
            <div class="span7">
              <div class="alert alert-success">
                <strong>A jugar se a dicho!!!</strong>
              </div>
            </div>
          </div> -->
          
        </div>
        
        
        <!-- Body vertical menor -->
        <div class="span3">
          
          <!-- Login Form -->
          <div class="well">
          <!--Sidebar content-->
           <?php echo form_open('login/validate'); ?>
      
              <?php echo form_input('user',set_value('user'), 'class="input-medim" placeholder="Correo electr&oacute;nico"'); ?><br>
              <div style="color: red">
                <?php echo form_error('user'); ?><br>
              </div>
              
              <?php echo form_password('pass', set_value('pass'), 'class="input-medim" placeholder="Contrase&ntilde;a"'); ?><br>
              <div style="color: red">
                <?php echo form_error('pass'); ?><br>
              </div>
              
              <?php echo form_submit(array('name'=>'enter', 'class'=>'btn btn-primary', 'value'=>'Aceptar')); ?>
              <br><br>
              <ul class="pager">
                <li>
                  <?php echo anchor('user/create','Quiero registrarme'); ?>
                </li>
              </ul>
            <?php echo form_close(); ?>
          </div>
          
          <div class="well">
            <a href="<?php echo $login_url ?>">
              <div style="background: url(<?php echo base_url(); ?>assets/img/login.gif); width: 169px;height: 21px; cursor: pointer;"></div>
            </a>
          </div>
          
          
          
          <!-- Login de actividades -->
          <div class="well">
            <table class="table table-striped table-bordered table-condensed;" width="100%">
              <?php
              if($activities != null)
              {
                foreach($activities as $a)
                      {
                        echo '<tr><td>';
                        echo '<div style="text-align: left">';
                        echo '<table style="border: hidden" width="100%" >
                                <tr>
                                  <td style="border: hidden">
                                    <a href="#" class="thumbnail" style="width: 50px">';
                                  if($a['picture'] == null || $a['picture'] == "")
                                  {
                                    echo '<img src="'.base_url().'assets/img/user.png" width="50" height="50">';
                                  }
                                  else
                                  {
                                    echo '<img src="'.$a['picture'].'" width="50" height="50">';
                                  }
                        echo '      </a>
                                  </td>';
                        echo '    <td style="border: hidden">
                                    <strong>'
                                      . substr($a['name'], 0, 15).'
                                    </strong>
                                    <br>';
                        echo '      <div style="width: 100%; text-align: right;font-size: 9px">'.$a['operation'].'<br>';
                        echo '        <strong>';
                        $fecha = explode(' ',$a['date']);
                        $dia = explode('-',$fecha[0]);
                        $hora = explode(':',$fecha[1]);
                        echo 'El '.$dia[2].'-'.$dia[1].'-'.$dia[0].' a las '.$hora[0].':'.$hora[1];
                        echo '        </strong>
                                    </div>
                                  </td>
                                </tr>
                              </table>';
                        echo '</div>';
                        echo '</td></tr>';
                      }
              }
              ?>
            </table>
          </div>
        </div>
      </div>
    </div>
  </center>